<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script
            src="https://code.jquery.com/jquery-3.4.1.min.js"
            integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
            crossorigin="anonymous"></script>
</head>
<body>
<p>serviceUrl: ${serviceUrl!}</p>
<form id="myform">
<p>name: <input name="name"/></p>
<p>passwd: <input type="password" name="passwd"/></p>
<p><a onclick="doLogin();" href="#">提交</a></p>
</form>
<script>

    function doLogin(){
        var param = $("#myform").serialize();
        $.post("${request.contextPath}/doLogin?serviceUrl=${serviceUrl!}&"+param,function(data){
            debugger;
            console.log(data);
            if(data.success){
                window.location.href=data.redirectUrl;
            }else{
                alert(data.msg);
            }
        },"json");
    }
</script>
</body>
</html>